package com.example.Controller;

import com.example.Pojo.Login;
import com.example.Result.AllResult;
import com.example.Service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping("/login")
    public AllResult login(@RequestBody Login login){
        System.out.println(login);
        return AllResult.allResult(loginService.getLoginCode(login),"message",null);
    }
    @PostMapping("/register")
    public AllResult register(@RequestBody Login login){
        System.out.println(login);
        return AllResult.allResult(loginService.getRegisterCode(login),"message",null);
    }
}
